﻿@{
    var menus = new Dictionary<string, dynamic[]>();
    menus.Add("Admin", new dynamic[] {
        new { T = "顾客清单", A = "Customer", C = "Admin", R = new {}, H = new {} },        
        new { T = "调查表管理", A = "Table", C = "Admin", R = new {}, H = new {} },        
        new { T = "员工管理", A = "Employee", C = "Admin", R = new {}, H = new {} },
        new { T = "信息发布", A = "Notice", C = "Admin", R = new {}, H = new {} },
        new { T = "顾客满意度", A = "Survey", C = "Analyze", R = new {}, H = new {} },
        new { T = "意见与建议", A = "Suggestion", C = "Analyze", R = new {}, H = new {} },
        new { T = "先进个人推荐", A = "Recommend", C = "Analyze", R = new {}, H = new {} },
        new { T = "顾客名录", A = "All", C = "Customer", R = new {}, H = new {} },
        new { T = "对比分析", A = "Compare", C = "Analyze", R = new {}, H = new {} },
        new { T = "历史数据", A = "History", C = "Analyze", R = new {}, H = new {} },
        new { T = "系统设置", A = "Index", C = "System", R = new {}, H = new {} }
        });

    menus.Add("Department", new dynamic[] {
        new { T = "顾客满意度", A = "Survey", C = "Department", R = new {}, H = new {} },
        new { T = "意见与建议", A = "Suggestion", C = "Department", R = new {}, H = new {} },
        new { T = "先进个人推荐", A = "Recommend", C = "Department", R = new {}, H = new {} },
        new { T = "顾客名录", A = "List", C = "Customer", R = new {}, H = new {} },
        new { T = "对比分析", A = "Compare", C = "Department", R = new {}, H = new {} },
        new { T = "历史数据", A = "History", C = "Department", R = new {}, H = new {} } 
    });

    menus.Add("Leader", new dynamic[] { 
        new { T = "顾客满意度", A = "Survey", C = "Analyze", R = new {}, H = new {} },
        new { T = "意见与建议", A = "Suggestion", C = "Analyze", R = new {}, H = new {} },
        new { T = "先进个人推荐", A = "Recommend", C = "Analyze", R = new {}, H = new {} },
        new { T = "顾客名录", A = "All", C = "Customer", R = new {}, H = new {} },
        new { T = "对比分析", A = "Compare", C = "Analyze", R = new {}, H = new {} },
        new { T = "历史数据", A = "History", C = "Analyze", R = new {}, H = new {} } 
    });


    var roles = new string[] { "Department", "Admin", "Leader" };  
}
@foreach (var role in roles)
{
    if (User.IsInRole(role))
    {
    <ul id="@(role)_menu" class="menu">
        @foreach (dynamic item in menus[role])
        {
            <li class ="@(ViewContext.RouteData.Values["action"].ToString() == item.A && ViewContext.RouteData.Values["controller"].ToString() == item.C ? "selected" : "")" >
                @Html.ActionLink((string)item.T, (string)item.A, (string)item.C, (object)item.R, (object)item.H)</li>
        }
    </ul>
    }
}